package be.jprojects.tests.filter;

import java.awt.Component;

import javax.swing.ImageIcon;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import be.jprojects.subscription.logic.interfaces.IProvince;

public class ProvinceListCellRenderer implements ListCellRenderer {
	private static ImageIcon icon = new ImageIcon("Resources/province.png");

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		IProvince province =  (IProvince) value;
		
		FilterItemPanel fip = new FilterItemPanel();
		fip.setIcon(icon);
		fip.setTitle(province.getName());
		fip.setInfo(""+province.getId());
		
		return fip;
	}

}
